3.7.33 \(\int \sec ^m(c+d x) (a+a \sec (c+d x))^n (A+B \sec (c+d x)+C \sec ^2(c+d x)) \, dx\) [633]

3.7.33.1 Optimal result
3.7.33.2 Mathematica [F]
3.7.33.3 Rubi [A] (verified)
3.7.33.4 Maple [F]
3.7.33.5 Fricas [F]
3.7.33.6 Sympy [F]
3.7.33.7 Maxima [F]
3.7.33.8 Giac [F]
3.7.33.9 Mupad [F(-1)]

3.7.33.1 Optimal result

Integrand size = 41, antiderivative size = 259 \[ \int \sec ^m(c+d x) (a+a \sec (c+d x))^n \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {C \sec ^{1+m}(c+d x) (a+a \sec (c+d x))^n \sin (c+d x)}{d (1+m+n)}+\frac {2^{\frac {3}{2}+n} (C n+B (1+m+n)) \operatorname {AppellF1}\left (\frac {1}{2},1-m,-\frac {1}{2}-n,\frac {3}{2},1-\sec (c+d x),\frac {1}{2} (1-\sec (c+d x))\right ) (1+\sec (c+d x))^{-\frac {1}{2}-n} (a+a \sec (c+d x))^n \tan (c+d x)}{d (1+m+n)}+\frac {2^{\frac {1}{2}+n} (C (m-n)+A (1+m+n)-B (1+m+n)) \operatorname {AppellF1}\left (\frac {1}{2},1-m,\frac {1}{2}-n,\frac {3}{2},1-\sec (c+d x),\frac {1}{2} (1-\sec (c+d x))\right ) (1+\sec (c+d x))^{-\frac {1}{2}-n} (a+a \sec (c+d x))^n \tan (c+d x)}{d (1+m+n)} \]

output
C*sec(d*x+c)^(1+m)*(a+a*sec(d*x+c))^n*sin(d*x+c)/d/(1+m+n)+2^(3/2+n)*(C*n+ 
B*(1+m+n))*AppellF1(1/2,1-m,-1/2-n,3/2,1-sec(d*x+c),1/2-1/2*sec(d*x+c))*(1 
+sec(d*x+c))^(-1/2-n)*(a+a*sec(d*x+c))^n*tan(d*x+c)/d/(1+m+n)+2^(1/2+n)*(C 
*(m-n)+A*(1+m+n)-B*(1+m+n))*AppellF1(1/2,1-m,1/2-n,3/2,1-sec(d*x+c),1/2-1/ 
2*sec(d*x+c))*(1+sec(d*x+c))^(-1/2-n)*(a+a*sec(d*x+c))^n*tan(d*x+c)/d/(1+m 
+n)
 
3.7.33.2 Mathematica [F]

\[ \int \sec ^m(c+d x) (a+a \sec (c+d x))^n \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\int \sec ^m(c+d x) (a+a \sec (c+d x))^n \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx \]

input
Integrate[Sec[c + d*x]^m*(a + a*Sec[c + d*x])^n*(A + B*Sec[c + d*x] + C*Se 
c[c + d*x]^2),x]
 
output
Integrate[Sec[c + d*x]^m*(a + a*Sec[c + d*x])^n*(A + B*Sec[c + d*x] + C*Se 
c[c + d*x]^2), x]
 
3.7.33.3 Rubi [A] (verified)

Time = 1.05 (sec) , antiderivative size = 260, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.220, Rules used = {3042, 4576, 3042, 4511, 3042, 4315, 3042, 4312, 150}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \sec ^m(c+d x) (a \sec (c+d x)+a)^n \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \csc \left (c+d x+\frac {\pi }{2}\right )^m \left (a \csc \left (c+d x+\frac {\pi }{2}\right )+a\right )^n \left (A+B \csc \left (c+d x+\frac {\pi }{2}\right )+C \csc \left (c+d x+\frac {\pi }{2}\right )^2\right )dx\)

\(\Big \downarrow \) 4576

\(\displaystyle \frac {\int \sec ^m(c+d x) (\sec (c+d x) a+a)^n (a (C m+A (m+n+1))+a (C n+B (m+n+1)) \sec (c+d x))dx}{a (m+n+1)}+\frac {C \sin (c+d x) \sec ^{m+1}(c+d x) (a \sec (c+d x)+a)^n}{d (m+n+1)}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\int \csc \left (c+d x+\frac {\pi }{2}\right )^m \left (\csc \left (c+d x+\frac {\pi }{2}\right ) a+a\right )^n \left (a (C m+A (m+n+1))+a (C n+B (m+n+1)) \csc \left (c+d x+\frac {\pi }{2}\right )\right )dx}{a (m+n+1)}+\frac {C \sin (c+d x) \sec ^{m+1}(c+d x) (a \sec (c+d x)+a)^n}{d (m+n+1)}\)

\(\Big \downarrow \) 4511

\(\displaystyle \frac {a (A (m+n+1)-B (m+n+1)+C (m-n)) \int \sec ^m(c+d x) (\sec (c+d x) a+a)^ndx+(B (m+n+1)+C n) \int \sec ^m(c+d x) (\sec (c+d x) a+a)^{n+1}dx}{a (m+n+1)}+\frac {C \sin (c+d x) \sec ^{m+1}(c+d x) (a \sec (c+d x)+a)^n}{d (m+n+1)}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {a (A (m+n+1)-B (m+n+1)+C (m-n)) \int \csc \left (c+d x+\frac {\pi }{2}\right )^m \left (\csc \left (c+d x+\frac {\pi }{2}\right ) a+a\right )^ndx+(B (m+n+1)+C n) \int \csc \left (c+d x+\frac {\pi }{2}\right )^m \left (\csc \left (c+d x+\frac {\pi }{2}\right ) a+a\right )^{n+1}dx}{a (m+n+1)}+\frac {C \sin (c+d x) \sec ^{m+1}(c+d x) (a \sec (c+d x)+a)^n}{d (m+n+1)}\)

\(\Big \downarrow \) 4315

\(\displaystyle \frac {a (A (m+n+1)-B (m+n+1)+C (m-n)) (\sec (c+d x)+1)^{-n} (a \sec (c+d x)+a)^n \int \sec ^m(c+d x) (\sec (c+d x)+1)^ndx+a (B (m+n+1)+C n) (\sec (c+d x)+1)^{-n} (a \sec (c+d x)+a)^n \int \sec ^m(c+d x) (\sec (c+d x)+1)^{n+1}dx}{a (m+n+1)}+\frac {C \sin (c+d x) \sec ^{m+1}(c+d x) (a \sec (c+d x)+a)^n}{d (m+n+1)}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {a (A (m+n+1)-B (m+n+1)+C (m-n)) (\sec (c+d x)+1)^{-n} (a \sec (c+d x)+a)^n \int \csc \left (c+d x+\frac {\pi }{2}\right )^m \left (\csc \left (c+d x+\frac {\pi }{2}\right )+1\right )^ndx+a (B (m+n+1)+C n) (\sec (c+d x)+1)^{-n} (a \sec (c+d x)+a)^n \int \csc \left (c+d x+\frac {\pi }{2}\right )^m \left (\csc \left (c+d x+\frac {\pi }{2}\right )+1\right )^{n+1}dx}{a (m+n+1)}+\frac {C \sin (c+d x) \sec ^{m+1}(c+d x) (a \sec (c+d x)+a)^n}{d (m+n+1)}\)

\(\Big \downarrow \) 4312

\(\displaystyle \frac {\frac {a \tan (c+d x) (A (m+n+1)-B (m+n+1)+C (m-n)) (\sec (c+d x)+1)^{-n-\frac {1}{2}} (a \sec (c+d x)+a)^n \int \frac {\sec ^{m-1}(c+d x) (\sec (c+d x)+1)^{n-\frac {1}{2}}}{\sqrt {1-\sec (c+d x)}}d(1-\sec (c+d x))}{d \sqrt {1-\sec (c+d x)}}+\frac {a (B (m+n+1)+C n) \tan (c+d x) (\sec (c+d x)+1)^{-n-\frac {1}{2}} (a \sec (c+d x)+a)^n \int \frac {\sec ^{m-1}(c+d x) (\sec (c+d x)+1)^{n+\frac {1}{2}}}{\sqrt {1-\sec (c+d x)}}d(1-\sec (c+d x))}{d \sqrt {1-\sec (c+d x)}}}{a (m+n+1)}+\frac {C \sin (c+d x) \sec ^{m+1}(c+d x) (a \sec (c+d x)+a)^n}{d (m+n+1)}\)

\(\Big \downarrow \) 150

\(\displaystyle \frac {\frac {a 2^{n+\frac {1}{2}} \tan (c+d x) (A (m+n+1)-B (m+n+1)+C (m-n)) (\sec (c+d x)+1)^{-n-\frac {1}{2}} (a \sec (c+d x)+a)^n \operatorname {AppellF1}\left (\frac {1}{2},1-m,\frac {1}{2}-n,\frac {3}{2},1-\sec (c+d x),\frac {1}{2} (1-\sec (c+d x))\right )}{d}+\frac {a 2^{n+\frac {3}{2}} (B (m+n+1)+C n) \tan (c+d x) (\sec (c+d x)+1)^{-n-\frac {1}{2}} (a \sec (c+d x)+a)^n \operatorname {AppellF1}\left (\frac {1}{2},1-m,-n-\frac {1}{2},\frac {3}{2},1-\sec (c+d x),\frac {1}{2} (1-\sec (c+d x))\right )}{d}}{a (m+n+1)}+\frac {C \sin (c+d x) \sec ^{m+1}(c+d x) (a \sec (c+d x)+a)^n}{d (m+n+1)}\)

input
Int[Sec[c + d*x]^m*(a + a*Sec[c + d*x])^n*(A + B*Sec[c + d*x] + C*Sec[c + 
d*x]^2),x]
 
output
(C*Sec[c + d*x]^(1 + m)*(a + a*Sec[c + d*x])^n*Sin[c + d*x])/(d*(1 + m + n 
)) + ((2^(3/2 + n)*a*(C*n + B*(1 + m + n))*AppellF1[1/2, 1 - m, -1/2 - n, 
3/2, 1 - Sec[c + d*x], (1 - Sec[c + d*x])/2]*(1 + Sec[c + d*x])^(-1/2 - n) 
*(a + a*Sec[c + d*x])^n*Tan[c + d*x])/d + (2^(1/2 + n)*a*(C*(m - n) + A*(1 
 + m + n) - B*(1 + m + n))*AppellF1[1/2, 1 - m, 1/2 - n, 3/2, 1 - Sec[c + 
d*x], (1 - Sec[c + d*x])/2]*(1 + Sec[c + d*x])^(-1/2 - n)*(a + a*Sec[c + d 
*x])^n*Tan[c + d*x])/d)/(a*(1 + m + n))
 

3.7.33.3.1 Defintions of rubi rules used

rule 150
Int[((b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_)*((e_) + (f_.)*(x_))^(p_), x_ 
] :> Simp[c^n*e^p*((b*x)^(m + 1)/(b*(m + 1)))*AppellF1[m + 1, -n, -p, m + 2 
, (-d)*(x/c), (-f)*(x/e)], x] /; FreeQ[{b, c, d, e, f, m, n, p}, x] &&  !In 
tegerQ[m] &&  !IntegerQ[n] && GtQ[c, 0] && (IntegerQ[p] || GtQ[e, 0])
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4312
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + ( 
a_))^(m_), x_Symbol] :> Simp[(-(a*(d/b))^n)*(Cot[e + f*x]/(a^(n - 2)*f*Sqrt 
[a + b*Csc[e + f*x]]*Sqrt[a - b*Csc[e + f*x]]))   Subst[Int[(a - x)^(n - 1) 
*((2*a - x)^(m - 1/2)/Sqrt[x]), x], x, a - b*Csc[e + f*x]], x] /; FreeQ[{a, 
 b, d, e, f, m, n}, x] && EqQ[a^2 - b^2, 0] &&  !IntegerQ[m] && GtQ[a, 0] & 
&  !IntegerQ[n] && GtQ[a*(d/b), 0]
 

rule 4315
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + 
(a_))^(m_), x_Symbol] :> Simp[a^IntPart[m]*((a + b*Csc[e + f*x])^FracPart[m 
]/(1 + (b/a)*Csc[e + f*x])^FracPart[m])   Int[(1 + (b/a)*Csc[e + f*x])^m*(d 
*Csc[e + f*x])^n, x], x] /; FreeQ[{a, b, d, e, f, m, n}, x] && EqQ[a^2 - b^ 
2, 0] &&  !IntegerQ[m] &&  !GtQ[a, 0]
 

rule 4511
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + ( 
a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)), x_Symbol] :> Simp[(A*b - 
a*B)/b   Int[(a + b*Csc[e + f*x])^m*(d*Csc[e + f*x])^n, x], x] + Simp[B/b 
 Int[(a + b*Csc[e + f*x])^(m + 1)*(d*Csc[e + f*x])^n, x], x] /; FreeQ[{a, b 
, d, e, f, A, B, m}, x] && NeQ[A*b - a*B, 0] && EqQ[a^2 - b^2, 0]
 

rule 4576
Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_. 
))*(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a 
_))^(m_), x_Symbol] :> Simp[(-C)*Cot[e + f*x]*(a + b*Csc[e + f*x])^m*((d*Cs 
c[e + f*x])^n/(f*(m + n + 1))), x] + Simp[1/(b*(m + n + 1))   Int[(a + b*Cs 
c[e + f*x])^m*(d*Csc[e + f*x])^n*Simp[A*b*(m + n + 1) + b*C*n + (a*C*m + b* 
B*(m + n + 1))*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, d, e, f, A, B, C, m 
, n}, x] && EqQ[a^2 - b^2, 0] &&  !LtQ[m, -2^(-1)] &&  !LtQ[n, -2^(-1)] && 
NeQ[m + n + 1, 0]
 
3.7.33.4 Maple [F]

\[\int \sec \left (d x +c \right )^{m} \left (a +a \sec \left (d x +c \right )\right )^{n} \left (A +B \sec \left (d x +c \right )+C \sec \left (d x +c \right )^{2}\right )d x\]

input
int(sec(d*x+c)^m*(a+a*sec(d*x+c))^n*(A+B*sec(d*x+c)+C*sec(d*x+c)^2),x)
 
output
int(sec(d*x+c)^m*(a+a*sec(d*x+c))^n*(A+B*sec(d*x+c)+C*sec(d*x+c)^2),x)
 
3.7.33.5 Fricas [F]

\[ \int \sec ^m(c+d x) (a+a \sec (c+d x))^n \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\int { {\left (C \sec \left (d x + c\right )^{2} + B \sec \left (d x + c\right ) + A\right )} {\left (a \sec \left (d x + c\right ) + a\right )}^{n} \sec \left (d x + c\right )^{m} \,d x } \]

input
integrate(sec(d*x+c)^m*(a+a*sec(d*x+c))^n*(A+B*sec(d*x+c)+C*sec(d*x+c)^2), 
x, algorithm="fricas")
 
output
integral((C*sec(d*x + c)^2 + B*sec(d*x + c) + A)*(a*sec(d*x + c) + a)^n*se 
c(d*x + c)^m, x)
 
3.7.33.6 Sympy [F]

\[ \int \sec ^m(c+d x) (a+a \sec (c+d x))^n \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\int \left (a \left (\sec {\left (c + d x \right )} + 1\right )\right )^{n} \left (A + B \sec {\left (c + d x \right )} + C \sec ^{2}{\left (c + d x \right )}\right ) \sec ^{m}{\left (c + d x \right )}\, dx \]

input
integrate(sec(d*x+c)**m*(a+a*sec(d*x+c))**n*(A+B*sec(d*x+c)+C*sec(d*x+c)** 
2),x)
 
output
Integral((a*(sec(c + d*x) + 1))**n*(A + B*sec(c + d*x) + C*sec(c + d*x)**2 
)*sec(c + d*x)**m, x)
 
3.7.33.7 Maxima [F]

\[ \int \sec ^m(c+d x) (a+a \sec (c+d x))^n \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\int { {\left (C \sec \left (d x + c\right )^{2} + B \sec \left (d x + c\right ) + A\right )} {\left (a \sec \left (d x + c\right ) + a\right )}^{n} \sec \left (d x + c\right )^{m} \,d x } \]

input
integrate(sec(d*x+c)^m*(a+a*sec(d*x+c))^n*(A+B*sec(d*x+c)+C*sec(d*x+c)^2), 
x, algorithm="maxima")
 
output
integrate((C*sec(d*x + c)^2 + B*sec(d*x + c) + A)*(a*sec(d*x + c) + a)^n*s 
ec(d*x + c)^m, x)
 
3.7.33.8 Giac [F]

\[ \int \sec ^m(c+d x) (a+a \sec (c+d x))^n \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\int { {\left (C \sec \left (d x + c\right )^{2} + B \sec \left (d x + c\right ) + A\right )} {\left (a \sec \left (d x + c\right ) + a\right )}^{n} \sec \left (d x + c\right )^{m} \,d x } \]

input
integrate(sec(d*x+c)^m*(a+a*sec(d*x+c))^n*(A+B*sec(d*x+c)+C*sec(d*x+c)^2), 
x, algorithm="giac")
 
output
integrate((C*sec(d*x + c)^2 + B*sec(d*x + c) + A)*(a*sec(d*x + c) + a)^n*s 
ec(d*x + c)^m, x)
 
3.7.33.9 Mupad [F(-1)]

Timed out. \[ \int \sec ^m(c+d x) (a+a \sec (c+d x))^n \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\int {\left (a+\frac {a}{\cos \left (c+d\,x\right )}\right )}^n\,{\left (\frac {1}{\cos \left (c+d\,x\right )}\right )}^m\,\left (A+\frac {B}{\cos \left (c+d\,x\right )}+\frac {C}{{\cos \left (c+d\,x\right )}^2}\right ) \,d x \]

input
int((a + a/cos(c + d*x))^n*(1/cos(c + d*x))^m*(A + B/cos(c + d*x) + C/cos( 
c + d*x)^2),x)
 
output
int((a + a/cos(c + d*x))^n*(1/cos(c + d*x))^m*(A + B/cos(c + d*x) + C/cos( 
c + d*x)^2), x)